#include <iostream>
using namespace std;
//自定义类型向自定义类型转换
class CNY;
class USD{
public:
    USD(double value)
        :_value(value)
    {}
    operator CNY();
    void print(){
        cout<<"print"<<_value<<endl;
    }
private:
    double _value;
};
class CNY{
public:
    CNY(double value)
        :_value(value)
    {}
    operator USD();
    void print(){
        cout << "print"<<_value<<endl;
    }
private:
    double _value;
};
//转换为CNY类型
USD::operator CNY(){
return CNY(_value * 7.2);
}
CNY::operator USD(){
    return USD(_value / 7.2);
}
void test(){
  USD u(100);
  CNY c = u;
  c.print();
}
int main()
{
    test();
    return 0;
}

